<?php

use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;

class CreateWechatQrcodesTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('wechat_qrcodes', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->unsignedBigInteger('user_id',false)->default(0)->index()->comment('用户id');
            $table->string('type',15)->nullable()->comment('二维码类型');
            $table->string('params',200)->nullable()->comment('二维码参数');
            $table->string('image',150)->nullable()->comment('二维码图片');
            $table->string('poster_img',150)->nullable()->comment('海报地址');
            $table->string('platform',15)->default('miniprogram')->comment('二维码平台');
            $table->timestamps();
            $table->engine="InnoDb";
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('wechat_qrcodes');
    }
}
